﻿using System;
using Microsoft.Extensions.Configuration;

namespace Machine.Model.ConfigModel
{
    /// <summary>
    /// 
    /// </summary>
    public class ConnectionConfigModel:BaseConfigModel
    {
        public ConnectionConfigModel(){
            try
            {
                if(Configuration["Remote"]=="true"){
                    ConnectionStr = Configuration["ConnectionStrings:RemoteConnection"];
                    FileConnectionStr = Configuration["ConnectionStrings:FileRemoteConnection"];
                }else{
                    ConnectionStr = Configuration["ConnectionStrings:DefaultConnection"];
                    FileConnectionStr = Configuration["ConnectionStrings:FileDefaultConnection"];
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }
        }

        public string ConnectionStr = "";
        public string FileConnectionStr = "";
    }
}
